<!-- Module PrestaTheme -->
{capture name=path}{l s='My projects' mod='prestatheme'}{/capture}
{include file="$tpl_dir./breadcrumb.tpl"}

<h2>{l s='My prestatheme projects' mod='prestatheme'}</h2>
{include file="$tpl_dir./errors.tpl"}

<p>
    <a href="{$link->getModuleLink('prestatheme', 'myprojects', ['edit'=>'1'], true)}" title="{l s='Create a new project' mod='prestatheme'}">
        <img src="{$img_dir}icon/pt_add.png" alt="{l s='Add New' mod='prestatheme'}" class="icon" />
    </a>
    <a href="{$link->getModuleLink('prestatheme', 'myprojects', ['edit'=>'1'], true)}" title="{l s='Create a new project' mod='prestatheme'}">
        {l s='Create a new project' mod='prestatheme'}
    </a>
</p>

{if $projects AND count($projects)}
    <table style="width: 100%;" class="std">
        <thead>
            <tr>
                <th class="first_item">{l s='Name' mod='prestatheme'}</th>
                <th class="item">{l s='CMS' mod='prestatheme'}</th>
                <th class="item">{l s='Is public' mod='prestatheme'}</th>
                <th class="item">{l s='Created On' mod='prestatheme'}</th>
                <th class="item">{l s='Last Update' mod='prestatheme'}</th>
                <th class="last_item" style="width:65px">&nbsp;</th>
            </tr>
        </thead>
        
        <tbody>
        {foreach from=$projects item=project name=myLoop}
        	<tr>
            <tr class="{if $smarty.foreach.myLoop.first}first_item{elseif $smarty.foreach.myLoop.last}last_item{else}item{/if} {if $smarty.foreach.myLoop.index % 2}alternate_item{/if}">
        		<td>{$project->name}</td>
        		<td>{$project->getCMSName()}</td>
        		<td>
                    {if $project->is_public}
                        {l s='Yes' mod='prestatheme'}
                    {else}
                        {l s='No' mod='prestatheme'}
                    {/if}
                </td>
                <td>{dateFormat date=$project->date_add full=0}</td>
                <td>{dateFormat date=$project->date_upd full=0}</td>
                <td>
                    <a href="{$link->getModuleLink('prestatheme', 'myprojects', ['view'=>'1', 'id_project'=>$project->id], true)}" title="{l s='View details' mod='prestatheme'}">
                        <img src="{$img_dir}icon/pt_view.png" alt="{l s='View' mod='prestatheme'}" class="icon" />
                    </a>
                    <a href="{$link->getModuleLink('prestatheme', 'myprojects', ['edit'=>'1', 'id_project'=>$project->id], true)}" title="{l s='Edit informations' mod='prestatheme'}">
                        <img src="{$img_dir}icon/pt_edit.png" alt="{l s='Edit' mod='prestatheme'}" class="icon" />
                    </a>
                    <a href="{$link->getModuleLink('prestatheme', 'myprojects', ['run-editor'=>'1', 'id_project'=>$project->id], true)}" title="{l s='Run the pretatheme editor' mod='prestatheme'}">
                        <img src="{$img_dir}icon/pt_editor.png" alt="{l s='Theme Editor' mod='prestatheme'}" class="icon" />
                    </a>
                    <a href="{$link->getModuleLink('prestatheme', 'myprojects', ['make-package'=>'1', 'id_project'=>$project->id], true)}" title="{l s='Generate the theme' mod='prestatheme'}">
                        <img src="{$img_dir}icon/pt_packager.png" alt="{l s='Make package' mod='prestatheme'}" class="icon" />
                    </a>
                </td>
        	</tr>
        {/foreach}
        </tbody>
    </table>
{else}
    <p class="warning">{l s='You don\'t have any projects' mod='prestatheme'}</p>
{/if}
<!-- /Module PrestaTheme -->
